<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/fuwu.css">
    <link rel="stylesheet" href="common/swiper/swiper-bundle.min.css">
    <script src="js/jquery.js"></script>
    <script src="common/swiper/swiper-bundle.esm.browser.min.js"></script>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="common/swiper/swiper-bundle.min.css">
    <link rel="stylesheet" href="common/bootstrap/css/bootstrap.min.css">
</head>
<body>
<div class="renovation-hearder centre">
    <ul class="main-top centres">
        <li><a href="#">登录/注册</a></li>
        <li><a href="#">APP/公众号</a></li>
        <li><a href="#">商业合作</a></li>
        <li><a href="#">咨询热线：4000-787-012</a></li>
    </ul>
    <div class="main-bottom centres flex">
        <div class="logo"><img src="../img/logo.jpg" alt=""></div>
        <ul class="main-nav">
            <li><a href="index">首页</a></li>
            <li><a href="zhuangxiu">装修公司</a></li>
            <li><a href="shejishi">设计师</a></li>
            <li><a href="effect">效果图</a></li>
            <li><a href="fuwu" class="active">服务</a></li>
        </ul>
        <div class="main-search ">
            <div class="bule">
                装修公司
                <span class="glyphicon glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
            </div>
            <input type="search" name="" id="" placeholder="请输入公司名称或关键字"/>
        </div>
    </div>
</div><!--头部-->
<div class="center">
    <div class="centerTop">
        <p class="title">我家装修要花多少钱?</p>
        <p class="titles">要装修，先了解情价，10秒快速出报价</p>
    </div>
    <div class="centerBottom">
        <div class="centerBottoms flexss">
            <div class="centerbottomsLeft">
                <p>装修计算器<span>今天已有1857位业主获取了装修预算</span></p>
                <form action="#" class="form">
                    <div class="forms flexss">
                        <p>所在城市：<span>*</span></p>
                        <input type="text" id="city" placeholder="山东"/>
                    </div>
                    <div class="forms flexss">
                        <p>房屋面积：<span>*</span></p>
                        <input type="text" id="house_area" placeholder="请输入您的房屋面积">
                    </div>
                    <div class="forms flexss">
                        <p>房屋户型：<span>*</span></p>
                        <select name="edu" id="edu">
                            <option value="1">1室1厅1卫1阳台</option>
                            <option value="2">2室2厅2卫2阳台</option>
                            <option value="3">3室3厅3卫3阳台</option>
                        </select>
                    </div>
                    <div class="forms flexss">
                        <p>手机号码：<span>*</span></p>
                        <input type="text" id="phone" placeholder="报价结果将发送到您的手机">
                    </div>
                    <p class="formRight">*为了您的权益。您的隐私将被严格保密。</p>
                </form>
            </div><!--centerbottomsLeft-->
            <div class="centerbottomsCenter">
                <p class="cbcBorder"></p>
                <p class="cbcCircle" onclick="startComputer()">开始计算</p>
            </div><!--centerbottomsCenter-->
            <div class="centerbottomsRight">
                <p>您家的装修预算<span id="price">86221</span>元</p>
                <div class="centerbottomsRights">
                    <p>材料费：<span class="span1" id="clPrice">13002</span><span class="span2">元</span></p>
                    <p>人工费：<span class="span1" id="rgPrice">70165</span><span class="span2">元</span></p>
                    <p>设计费：<span class="span1" id="sjPrice">6895</span><span class="span2">元</span></p>
                    <p>质检费：<span class="span1" id="zjPrice">2564</span><span class="span2">元</span></p>
                </div><!--centerbottomsRights-->
                <div class="count">声明:装修预算数据基于装修之家上千万业主装修数据经过大数据分析得出。装修之家为您提供专业、透明、准确的装修报价，该项服务绝不产生任何费用。</div>
            </div><!--centerbottomsRight-->
        </div><!--centerBottoms-->
    </div><!--centerBottom-->
</div>
<div class="renovation-bottom  centre">
    <div class=" cent  ">
        <div class="bottom-top ">
            <div class="bot-left">
                <ul class="about-bot">
                    <h5>关于我们</h5>
                    <li><a href="#">关于我们</a></li>
                    <li><a href="#">联系我们</a></li>
                    <li><a href="#"> 招贤纳士</a></li>
                    <li><a href="#">商务合作</a></li>
                </ul>
                <ul class="about-bot">
                    <h5>新手上路</h5>
                    <li><a href="#">免费注册</a></li>
                    <li><a href="#">免费设计</a></li>
                    <li><a href="#">免费报价</a></li>
                    <li><a href="#">牯修攻路</a></li>
                </ul>
                <ul class="about-bot">
                    <h5>帮助中心</h5>
                    <li><a href="#">忘记密码</a></li>
                    <li><a href="#">侵权投诉</a></li>
                    <li><a href="#">法律声明</a></li>
                    <li><a href="#">装修问答</a></li>
                </ul>
                <ul class="about-bot">
                    <h5>全国统一电话: <span>  4000-787-012</span></h5>
                    <li><a href="#">在线咨询:8:30-18:00</a></li>
                    <li><a href="#">业务电话:4000-7B7-012</a></li>
                    <li><a href="#"> 公司地址:山东省济南市历城区二环东路东环国际广场D做12层</a></li>
                </ul>
            </div>
            <div class="bot-right">
                <img src="../img/weweima_03.png" alt="">
                <p>关注公众号</p>
            </div>

        </div>
        <div class="bottom-center">
            <div class="cen-top"><span>热门装修网</span>&nbsp;&nbsp; 友情链接</div>
            <div class="cen-bot">武汉菠修 阿合肥痿 悠网杭州 装修网 无镶装修 网青岛芒 修网兰州 搂修网地 尔滨镂悠 网沈归装 修网太原 装修网广 州荟修网 兰州装修
                网|兔尔谚褛修网汰阳菽悠网太原”儋网广州眩修网武汉袭修网合肥装悠网杭洲装修网无镶裘悠网青岛茁修网兰州搂修网哈尔演偻修网沈知蔽修网太原装修网广州装修网兰州装修网耽尔演褛修网沈阳咳悠网太原碳修网广州陆修网
            </div>

        </div>
        <div class="bottom-bottom">
            <div class="bot-wen">
                <div>免责声明:本网站部分内容由用户自行上传，如权利人发现存在误传其作品情形，请及时与本站联系。装修之家我网保留所有权利</div>
                <div> Copyright@2010-2021济南六度网络技术有限公司zzhijia.comALlLRightls
                    Resenved.备案号:鲁ICP备12026533号鲁公网安备37011202000873号
                </div>
            </div>
            <div class="bot-img">
                <img src="../img/30.jpg" alt="">
                <img src="../img/31.jpg" alt="">
            </div>
        </div>
    </div>
</div><!--bottom-->
</body>
</html>

<script>
    function startComputer() {
        let city = $("#city").val();
        let house_area = $("#house_area").val();
        let edu = $("#edu").val();
        let phone = $("#phone").val();

        if (city == '' || city == null) {
            alert("请输入所在城市");
            return;
        }

        if (!isNumber(house_area)) {
            alert("请正确输入房屋面积");
            return;
        }

        if (!isPhone(phone)) {
            alert("请正确输入手机号");
            return;
        }


        //模拟计算
        let price = 15000 * house_area * edu;

        //clPrice
        // rgPrice
        // sjPrice
        // zjPrice

        console.log(price);
        $("#price").html(price);


        //材料费
        let clPrice = price/8*4
        $("#clPrice").html(clPrice);


        //人工费
        let rgPrice = price/8*2
        $("#rgPrice").html(rgPrice);

        //设计费
        let sjPrice = price/8*1
        $("#sjPrice").html(sjPrice);

        //质检费
        let zjPrice = price/8*1
        $("#zjPrice").html(zjPrice);




    }


    function isNumber(val) {
        //非负浮点数
        var regPos = /^\d+(\.\d+)?$/;
        //负浮点数
        var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;
        if (regPos.test(val) || regNeg.test(val)) {
            return true;
        } else {
            return false;
        }
    }

    function isPhone(phone) {
        var patt = /^[1][3-9][\d]{9}/;

        if (patt.test(phone)) {
            return true;
        } else {
            return false;
        }

    }

</script>
